package com.crm.modules.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.crm.modules.entities.FactoryWarehouse;
import com.crm.modules.mapper.FactoryMgmtMapper;
import com.crm.modules.mapper.FactoryWarehouseMapper;
import com.crm.modules.service.FactoryWarehouseService;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 厂家合作仓库Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-21
 */
@Service
public class FactoryWarehouseServiceImpl extends ServiceImpl<FactoryWarehouseMapper, FactoryWarehouse> implements FactoryWarehouseService
{
    @Autowired
    private FactoryWarehouseMapper crmFactoryWarehouseMapper;

    /**
     * 查询厂家合作仓库
     * 
     * @param id 厂家合作仓库主键
     * @return 厂家合作仓库
     */
    @Override
    public FactoryWarehouse selectById(String id)
    {
        return crmFactoryWarehouseMapper.selectById(id);
    }

    /**
     * 查询厂家合作仓库列表
     * 
     * @param crmFactoryWarehouse 厂家合作仓库
     * @return 厂家合作仓库
     */
    @Override
    public List<FactoryWarehouse> selectList(FactoryWarehouse crmFactoryWarehouse)
    {
        return crmFactoryWarehouseMapper.selectList(crmFactoryWarehouse);
    }

    /**
     * 新增厂家合作仓库
     * 
     * @param crmFactoryWarehouse 厂家合作仓库
     * @return 结果
     */
    @Override
    public int insert(FactoryWarehouse crmFactoryWarehouse)
    {
        crmFactoryWarehouse.setCreateTime(DateUtils.getNowDate());
        return crmFactoryWarehouseMapper.insert(crmFactoryWarehouse);
    }

    /**
     * 修改厂家合作仓库
     * 
     * @param crmFactoryWarehouse 厂家合作仓库
     * @return 结果
     */
//    @Override
//    public int updateById(FactoryWarehouse crmFactoryWarehouse)
//    {
//        crmFactoryWarehouse.setUpdateTime(DateUtils.getNowDate());
//        return crmFactoryWarehouseMapper.updateById(crmFactoryWarehouse);
//    }

    /**
     * 批量删除厂家合作仓库
     * 
     * @param ids 需要删除的厂家合作仓库主键
     * @return 结果
     */
    @Override
    public int deleteByIds(String[] ids)
    {
        return crmFactoryWarehouseMapper.deleteByIds(ids);
    }

    /**
     * 删除厂家合作仓库信息
     * 
     * @param id 厂家合作仓库主键
     * @return 结果
     */
    @Override
    public int deleteById(String id)
    {
        return crmFactoryWarehouseMapper.deleteById(id);
    }
}
